<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<% 
   String mouth=request.getParameter("month"); 
   String driverId=request.getParameter("driverId"); 
   %>
<!DOCTYPE HTML>
<html>
<head>
    <base href="${ctx }/">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link rel="stylesheet" href="plugin/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/bootstrap-datetimepicker.css"/>
    <link rel="stylesheet" href="plugin/bootstrap-table/dist/bootstrap-table.css">
    <!-- <link rel="stylesheet" href="css/zoom.css" media="all" />  -->
    <link rel="stylesheet" href="alert/alert.css">
</head>
<body>
<div class="container-fluid">
    <div class="container row" id="query">
        <div>
            <ul class="breadcrumb">
                <li>
                    <i class="icon-home home-icon"></i>
                    <a href="javascript:void(0)">Finance Management(财务管理)</a>
                </li>
                <li class="active">
                    <a href="view/finance/weekorder.jsp">Weekly Statement(周结算订单)</a>
                </li>
                <li class="active">
                    <a href="javascript:void(0)">Weekly Statement Detail(周结算订单)</a>
                </li>
            </ul>
        </div>
        <br>
    </div>

    <table id="demo-table"></table>
</div>
</body>

<!-- 加载需要的js -->
<script src="js/jquery-3.2.1.min.js"></script>
<script src="plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="js/jquery-bootstrap-pagination.js"></script>
<script src="plugin/bootstrap-table/dist/bootstrap-table.min.js"></script>
<script src="plugin/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
<script src='alert/alert.js'></script>
<!--时间  -->
<script src="js/bootstrap-datetimepicker.js"></script>
<script src="js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="js/common.js"></script>
<script src="plugin/layer/layer.js"></script>
<script type="text/javascript" charset="utf-8">
    var M = {}

    $('.form_date').datetimepicker({
        minView: "month", //选择日期后，不会再跳转去选择时分秒
        language: 'zh-CN',
        format: 'dd/mm/yyyy',
        todayBtn: 1,
        autoclose: 1,
    });

    $(function () {
        initPath("${ctx }");
        initTable('demo-table', queryParams, columns, "finance/week/info");
    });

    var columns = [
        {
            field: '',
            title: 'Serial Number(序号)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            return index + 1;
        }
        },
        {
            field: 'orderNo',
            title: 'Order number(订单号)',
            align: 'center',
            valign: 'middle'
        },
        {
            field: 'carType',
            title: 'Service category(服务类型)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var str="";
            	 if(value==1){
            		 str="fab ONE";
            	 }else if(value==2){
            		 str="fab";
            	 }else{
            		 str="fab PRO";
            	 }
                return str;
            }
        },
        {
            field: 'startFee',
            title: 'Base Fare(起步价)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var c=value==null?"0":value;
                return '$ '+c;
            }
        },
        {
            field: 'mileage',
            title: 'Mileage(里程)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var mileage=row.mileage==null?"0":row.mileage;
            	var mileageMoney=row.mileageMoney==null?"0":row.mileageMoney;
                return '('+mileage+' KM )$ '+mileageMoney;
            }
        },
        {
            field: 'times',
            title: 'Min(时长)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var time=row.time==null?"0":row.time;
            	var timeFee=row.timeFee==null?"0":row.timeFee;
                return '('+time+')$ '+timeFee;
            }
        },
        {
            field: 'serveiceCharge',
            title: 'Toll(过路费)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var serveiceCharge=row.serveiceCharge==null?"0":row.serveiceCharge;
                return '$ '+serveiceCharge;
            }
        },
        {
            field: 'bookingFee',
            title: 'Booking Fee(预定费)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var v=value==null?"0":value;
                return '$ '+v+"";
            }
        },
        {
            field: 'totalFee',
            title: 'Total(总收入)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var v=value==null?"0":value;
                return '$ '+v;
            }
        },
        {
            field: 'couponMoney',
            title: 'Voucher(优惠劵)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var v=value==null?"0":value;
                return '$ '+v;
            }
        },
        {
            field: 'totals',
            title: 'Payment less Voucher(实付金额)',
            align: 'center',
            valign: 'middle',
            formatter: function (value, row, index) {
            	var v=value==null?"0":value;
                return '$ '+v;
            }
        }
    ];

    function queryParams(params) {
        var param = {
            month: '<%=request.getParameter("month")%>',
            driverId:'<%=request.getParameter("driverId")%>',
            pageNo: this.pageNumber,
            pageSize: this.pageSize
        }
        return param;
    }
</script>
</html>


